package com.jch.learn.config;

import com.jch.learn.model.AppConf;
import com.jch.learn.plugin.NacosPlugin;
import com.jfinal.config.*;
import com.jfinal.template.Engine;


public class WebAppConfig extends JFinalConfig {

    private static AppConf conf = null;

    @Override
    public void configConstant(Constants constants) {
        conf = YamlConfigKit.read("conf.yml",AppConf.class);
        constants.setDevMode(true);
    }

    @Override
    public void configRoute(Routes routes) {
        routes.scan("com.jch.learn.controller.");
    }

    @Override
    public void configEngine(Engine engine) {

    }

    @Override
    public void configPlugin(Plugins plugins) {
        plugins.add(new NacosPlugin(conf.nacosRegister));
    }

    @Override
    public void configInterceptor(Interceptors interceptors) {

    }

    @Override
    public void configHandler(Handlers handlers) {

    }

}
